import request from '@/utils/request'

export function login(data) {
  return request({
    // url: '/vue-admin-template/user/login',
    url: '/User/login',
    method: 'post',
    data
  })
}

export function getInfo(accesstoken) {
  return request({
    // url: '/vue-admin-template/user/info',
    url: '/User/info',
    method: 'get',
    params: { accesstoken }
  })
}

export function logout(accesstoken) {
  return request({
    // url: '/vue-admin-template/user/logout',
    url: '/User/logout',
    method: 'get',
    params: { accesstoken }
  })
}

export function getUser(username,current,size) {
  return request({
    // url: '/vue-admin-template/user/logout',
    url: '/User/getUser',
    method: 'get',
    params: { username,current,size }
  })
}

export function updateRoleById(id, data) {
  return request({
    url: `/auth/updateRoleById/${id}`,
    method: 'put',
    data
  })
}

export function updatePermissionById(id, data) {
  return request({
    url: `/auth/updatePermissionById/${id}`,
    method: 'put',
    data
  })
}